package com.hz.wjy.controller;

import com.hz.wjy.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    UserService userService;

    @PostMapping("/user/add")
    public String addUser(@RequestParam("username") String username, @RequestParam("realname") String realname,
                          @RequestParam("schoolId") String schoolId, @RequestParam("userType") int userType,
                          @RequestParam("password") String password) {
        userService.addUser(username, realname, schoolId, password, userType);
        return "success";
    }

}
